package com.flot.yazb.model.nearly;

import com.flot.yazb.base.model.BModel;
import com.flot.yazb.base.client.RetrofitFactory;
import com.flot.yazb.aop.stub.RMCallback;
import com.flot.yazb.aop.stub.RMResponse;
import com.flot.yazb.retrofit.service.BService;
import com.flot.yazb.widget.utils.IsNullOrEmpty;

import java.util.List;
import java.util.Random;

/**
 * Created by fengdongfei on 2017/8/31.
 */

public class NearLyModel extends BModel {

    public static void getNearPeopleList(final Transit<NearLyModel[]> incubator) {
        RetrofitFactory.getInstance()
                .create(BService.UserService.class)
                .getNearPeopleList()
                .enqueue(new RMCallback<RMResponse<NearLyModel[]>>(incubator.getContext()) {
                    @Override
                    protected void onSuccess(RMResponse<NearLyModel[]> result) {
                        incubator.onBorn(result.content, result.code(), result.message());
                    }

                    @Override
                    protected void onFail(String errorCode, String errorInfo) {
                        incubator.onBorn(null, errorCode, errorInfo);
                    }
                });
    }

    public String age;
    public String mid;
    public String name;
    public String thumb;
    public String aihao;
    public String tezheng;
    public String beizhu;
    public String province="上海";
    public String distance;
    public List<String> pics;

    public String hit="";

    public String getHit(){
        if (IsNullOrEmpty.isEmpty(hit)){
            Random random=new Random();
            int x=random.nextInt(2000);
            return (x+50)+"";
        }
        return hit;
    }

}
